package com.zhouqinuan.spring.cloud.develop.framework.demo.provider.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhouqinuan.spring.cloud.develop.framework.base.util.BeanUtil;
import com.zhouqinuan.spring.cloud.develop.framework.demo.provider.feign.vo.req.GetUserInfoByIdReq;
import com.zhouqinuan.spring.cloud.develop.framework.demo.provider.feign.vo.resp.GetUserInfoByIdResp;
import com.zhouqinuan.spring.cloud.develop.framework.demo.provider.mapper.UserInfoMapper;
import com.zhouqinuan.spring.cloud.develop.framework.demo.provider.model.UserInfo;

@Service
public class UserService {

    @Autowired
    private UserInfoMapper userInfoMapper;

    public GetUserInfoByIdResp getUserInfoById(GetUserInfoByIdReq reqVO) {

        UserInfo userInfo = userInfoMapper.selectByPrimaryKey(reqVO.getId());

        return BeanUtil.mapToObject(userInfo, GetUserInfoByIdResp.class);
    }
}
